package org.wmq.taskschedule.factory;

import org.springframework.beans.BeanUtils;
import org.wmq.taskschedule.algorithm.AlgorithmExecutor;
import org.wmq.taskschedule.algorithm.MedianBlurExecutor;
import org.wmq.taskschedule.biz.model.DO.Param;

/**
 * 中值模糊算法执行器工厂类
 * 实现AlgorithmExecutorFactory接口，用于创建MedianBlurExecutor实例
 */
public class MedianBlurExecutorFactory implements AlgorithmExecutorFactory {
    private static final MedianBlurExecutorFactory instance = new MedianBlurExecutorFactory();

    private MedianBlurExecutorFactory() {}
    
    /**
     * 获取工厂实例
     * @return MedianBlurExecutorFactory实例
     */
    public static MedianBlurExecutorFactory getInstance() {
        return instance;
    }
    
    @Override
    public AlgorithmExecutor getAlgorithmExecutor(Param param) {
        MedianBlurExecutor medianBlurExecutor = new MedianBlurExecutor();
        BeanUtils.copyProperties(param, medianBlurExecutor);
        return medianBlurExecutor;
    }
}